class Charge(object): #充电基类，默认使用5V充电

    def charge5v(self): 
        pass

class Charge5v(Charge):

    def charge5v(self):
        print("使用5V充电")


class Charge220v(object): #现在要使用220v进行充电
    def charge220v(self):
        print("使用220V充电")


class Adapter(Charge):  #进行适配
    #charge220 = None
    def __init__(self, charge220):
        self.charge220 = charge220
    def charge5v(self):
        self.charge220.charge220v()
        print('220 转成5V充电了')

#charge = Charge5v()

#charge.charge5v()

charge2 = Charge220v()

adapter = Adapter(charge2)

adapter.charge5v()